{layout name="main"/}
<div class="wrapper wrapper-content animated fadeInUp">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">

                <div class="ibox-title">
                    <h5>我的奖金明细</h5>

                </div>

                <div class="ibox-content">
                    <div class="row m-b-sm m-t-sm">
                        <div class="col-sm-4">
                            <div class="input-daterange input-group" id="datepicker">
                                <input type="text" class="input-sm form-control" name="startdate" placeholder="开始时间" value="{$startdate}" />
                                <span class="input-group-addon">到</span>
                                <input type="text" class="input-sm form-control" name="enddate" placeholder="结束时间" value="{$enddate}" />
                            </div>

                        </div>

                        <div class="col-sm-1">
                            <button type="button" class="btn btn-primary" onclick="search()">搜索</button>
                        </div>
                        <div class="col-sm-7 text-right">
                            <div class="btn-group">
                                <a href="{:url('admin/User/userMoneyList',['user_id'=>$user_id])}" class="btn {if condition=" $award_type==-1 "}btn-primary{else}btn-white{/if} btn-sm" type="button">全部</a>
                                <a href="{:url('admin/User/userMoneyList',['award_type'=>1,'user_id'=>$user_id])}" class="btn {if condition=" $award_type==1 "}btn-primary{else}btn-white{/if} btn-sm" type="button">出局奖</a>
                                <a href="{:url('admin/User/userMoneyList',['award_type'=>0,'user_id'=>$user_id])}" class="btn {if condition=" $award_type==0 "}btn-primary{else}btn-white{/if} btn-sm" type="button">推荐奖</a>
                                <a href="{:url('admin/User/userMoneyList',['award_type'=>2,'user_id'=>$user_id])}" class="btn {if condition=" $award_type==2 "}btn-primary{else}btn-white{/if} btn-sm" type="button">财富币奖</a>
                            </div>
                        </div>
                    </div>
                    <div class="project-list">
                        <table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
                            <thead>
                                <tr role="row">

                                    <th style="width: 15%;">结算时间</th>
                                    <th style="width: 15%;">奖金类型</th>
                                    <th style="width: 10%;">金额</th>

                                    <th style="">备注</th>

                                </tr>
                            </thead>

                            <!--                            <tbody><tr class="no-records-found"><td colspan="8">没有找到匹配的记录</td></tr></tbody>-->

                            <tbody>

                              {:table_empty_list($list,'暂无数据!',4)}

                                {volist name="list" id="award"}
                                <tr class="gradeA">

                                    <td>{$award->create_time}</td>
                                    <td>{$award->award_type}</td>
                                    <td>{$award->cash_value}</td>

                                    <td>{$award->cash_flow_comments}</td>

                                </tr>
                                {/volist}

                            </tbody>

                        </table>
                        <!--                        <div class="row">
                                                    <div class="col-sm-6 m-t-sm">
                                                        <button class="btn btn-primary btn-xs" id="selectAll" onclick="deletearticle(1)"><i class="fa fa-check"></i> 全选 </button>
                                                        <button class="btn btn-warning btn-xs" id="deleteAll" onclick="deletearticle(1)"><i class="fa fa-trash"></i> 批量删除 </button>
                                                    </div>
                                                </div>-->
                        <div class="row">
                            <div class="col-sm-6">
                                <div class="dataTables_info" id="DataTables_Table_0_info" role="alert" aria-live="polite" aria-relevant="all">
                                    每页显示 {:getPageSize()} 项，共 {$list->toArray()['total']} 项</div>
                            </div>
                            <div class="col-sm-6">
                                <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
                                    {$list->render()}

                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <script>
                $(".input-daterange").datepicker({
                    keyboardNavigation: !1,
                    forceParse: !1,
                    autoclose: !0
                });
            </script>
            <script>
                function search() {
                    var url = "{:url('admin/User/userMoneyList', ['user_id'=>$user_id,'award_type'=>$award_type],'')}";
                    var startdate = $("input[name=startdate]").val();
                    var enddate = $("input[name=enddate]").val();
                    if (startdate != "") {
                        url = url + "/startdate/" + startdate;
                    }
                    if (enddate != "") {
                        url = url + "/enddate/" + enddate;
                    }
                    toUrl(url);
                }
                $(document).ready(function() {
                    $(".footable").footable();
                });
                $(".input-daterange").datepicker({
                    keyboardNavigation: !1,
                    forceParse: !1,
                    autoclose: !0
                });
            </script>
